package com.kjsb.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kjsb.entity.ProjectCategory;
import com.kjsb.vo.ProjectSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

import java.util.List;

/**
 * 项目类别数据库代理接口,动态代理
 * @author shi lintong
 */
@Mapper
public interface ProjectCategoryMapper extends BaseMapper<ProjectCategory> {
    /**
     * 通过项目类id查询项目id
     * @param categoryid
     * @return
     */
    List<Integer> selectProjectByCategoryid(int categoryid);

    /**
     * 通过项目类id删除所有项目
     * @param categoryid
     * @return
     */
    int deleteProjectByCategoryid(int categoryid);
    /**
     * 通过项目类id删除所有unit
     * @param categoryid
     * @return
     */
    int deleteAllUnitByCategoryId(int categoryid);

    /**
     * 通过项目类id删除该项目类
     * @param categoryid
     * @return
     */
    int deleteBycategoryid(int categoryid);
    /**
     * 通过项目类id查询unitid
     * @param categoryid
     * @return
     */
    List<Integer> selectAllUnitByCategoryId(int categoryid);

    /**
     * 通过专家id查询项目类
     * @param expertid
     * @return
     */
    @Select("select * from project_category where expertid=#{expertid}")
    List<ProjectCategory> getExpertProject(Integer expertid);
}
